<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Messenger/classes/PhpFox_ComponentAlert.class.php, $Author:  $ */



/** Top alert component
 *
 * @package module.messenger
 * @version $Id: PhpFox_ComponentAlert.class.php 448 2008-05-13 08:59:23Z phpfoxsv $
 *   PHPFox Team ()
 */
class PhpFox_Mod_Messenger_ComponentAlert extends BaseComponent
{
    /** Processing method
     */
	function process()
	{
		$iMess = '';
		if ( App::getUser('user') )
		{
		    $iMess = $this->oDatabase->getField('SELECT COUNT(*) FROM '. App::getT('mail') .' WHERE type = "mail" AND `to` ="'. App::getUser('user') .'" AND seen = "" AND is_del_sent!='.App::getUser('id').'');
		}

		$this->oTpl->assign(array
		(
			'lang_alert' => isset($iMess['count']) ? App::format('Mod_messenger.alert.member', array(App::makeUrl('public.account.messages'), '<span id="numEm">('. $iMess .')</span>')) : '',
			'notMember' => App::getUser('id'),
			'welcome_message' => App::format('new.alert.welcome',array(App::makeUrl('public.login'),App::makeUrl('public.signup'))),
		));
  		$srcHtml = $this->oTpl->fetch('Alert.html');
   		return $srcHtml;
	}
}
?>